package com.qcby.community.mapper;

import com.qcby.community.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-03-25
 */
@Repository
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT r.role_name FROM user_role ur,role r WHERE ur.role_id=r.role_id AND ur.user_id=#{user_id}")
    String getRoleNameByUserId(Integer userId);
}
